home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / borfix.zip / READ.ME < prev    next >
Text File  |  1989-12-09  |  2KB  |  51 lines

  1. *************** Generalized file I/O buffering *****************
  2.  
  3. The enclosed TP unit BUFFERS exports a new object BUFFERFILE. This
  4. object allows to define a variable number of buffers with a buffersize
  5. of up to $FFE0 bytes each. It exports a number of methods to tailor
  6. the behaviour of the buffer to a specific applications needs - See the
  7. following procedures for details in this area:
  8.  
  9.  - SETWRITEBIAS
  10.  - SETREADBIAS
  11.  - RESETBIAS
  12.  - ENABLEINBOUND
  13.  - ENABLEOUTBOUND
  14.  - DISABLEINBOUND
  15.  - DISABLEOUTBOUND
  16.  
  17. The buffers may be allocated in expanded memory if desired. Performance
  18. will be somewhat affected by this fact.
  19.  
  20. All methods use the same names as their counterparts in the system unit,
  21. the there should not be any problem implementing them. The only minor
  22. difference is the fact, that the READ and WRITE procedures do not accept
  23. the optional fourth parameter, which in the system unit will return the
  24. number of bytes actually read or written. This was done for performance
  25. reasons but should be very easy to change.
  26.  
  27. The unit is implemented using some of Turbo Pascals object oriented
  28. language constructs (actually my second step in this area). Some of the
  29. object oriented stuff is not really very pure code - some access to the
  30. imported data areas is direct, etc. This was done as to achieve some decent
  31. performance.
  32.  
  33. Last but not least a small example on how to use the code:
  34.  
  35. Program Test;
  36. VAR
  37.   BF : BufferFile;
  38.   L  : LongInt;
  39. begin
  40.   BF.Init(16384,5,True);
  41.   BF.SetWriteBias;           {Purely optional - may improve performance}
  42.   BF.Assign('TEST.FIL');
  43.   BF.Rewrite(4);
  44.   For L:=1 to 20000 do BF.Write(L,1);
  45.   BF.Done;
  46. end.
  47.  
  48. The code is herbey given to the public domain. If you discover any errors,
  49. I would appreciate if you would let me know.
  50.  
  51. Rolf Ernst 72311,254